package com.song.day06.ch6_3;

import java.util.concurrent.LinkedBlockingDeque;
import java.util.concurrent.TimeUnit;

public class Client  implements Runnable{
	
	private LinkedBlockingDeque<String> requestList;
	
	
	
	public Client(LinkedBlockingDeque<String> requestList) {
		super();
		this.requestList = requestList;
	}

	


	@Override
	public void run() {
		
		for( int i =0; i<3;i++)
		{
			for(int j=0; j<5;j++)
			{
				StringBuilder sb  = new StringBuilder();
				sb.append(i);
				sb.append(":");
				sb.append(j);
				try {
					requestList.put(sb.toString());
				} catch (InterruptedException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
			}
			
			try {
				TimeUnit.SECONDS.sleep(10);
			} catch (InterruptedException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
		}
		
		System.out.printf("client  :End \n");
	}

}
